<!DOCTYPE html>
<html >
  <head>
 
        <meta charset="utf-8">
        <meta name="csrf-token" content="{{ csrf_token() }}">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="@yield('description')">
        <meta name="author" content="mjr">
        <meta name="keyword" content="@yield('keyword')">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>管理后台-@yield('title')</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- Bootstrap 3.3.7 -->
        <link rel="stylesheet" href="{{asset('assets/bower_components/bootstrap/dist/css/bootstrap.min.css')}}">
        <!-- Font Awesome -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
      <!-- Bootstrap 3.3.7 -->
        <link rel="stylesheet" href="{{asset('assets/bower_components/bootstrap/dist/css/bootstrap.min.css')}}">
      <!-- Font Awesome -->
        <link rel="stylesheet" href="{{asset('assets/bower_components/font-awesome/css/font-awesome.min.css')}}">
      <!-- Ionicons -->
        <link rel="stylesheet" href="{{asset('assets/bower_components/Ionicons/css/ionicons.min.css')}}">
        <!-- DataTables -->
        <link rel="stylesheet" href="{{asset('assets/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css')}}">
      <!-- Theme style -->
        <link rel="stylesheet" href="{{asset('assets/dist/css/AdminLTE.min.css')}}">
      <!-- AdminLTE Skins. Choose a skin from the css/skins
           folder instead of downloading all of them to reduce the load. -->
        <link rel="stylesheet" href="{{asset('assets/dist/css/skins/_all-skins.min.css')}}">

      <!-- Google Font -->
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
        <link rel="shortcut icon" href="{{ asset('favicon.ico') }}"  type="image/x-icon" />
        <link rel="Bookmark" href="{{ asset('favicon.ico') }}" />
        <link rel="stylesheet" href="{{ asset('assets/layui/css/layui.css') }}">
        <style type="text/css">
        .error{color:red;}
        </style>
        @section( 'style' )
            <!-- load css here -->
            @show
        


  </head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
  
 
    @include('public.admin.header')

    @include('public.admin.sidebar')


  
    <!--  -->
    <div class="content-wrapper">
    
    @section('content')

    @show
    </div>
  
    @include('public.admin.footer')

       
   
</div>
<script src="{{asset('assets/bower_components/jquery/dist/jquery.js')}}"></script>
<!-- jQuery 3 -->
<script src="{{asset('assets/bower_components/jquery/dist/jquery.min.js')}}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="{{asset('assets/bower_components/bootstrap/dist/js/bootstrap.min.js')}}"></script>

<!-- SlimScroll -->
<script src="{{asset('assets/bower_components/jquery-slimscroll/jquery.slimscroll.min.js')}}"></script>
<!-- FastClick -->
<script src="{{asset('assets/bower_components/fastclick/lib/fastclick.js')}}"></script>
<!-- AdminLTE App -->
<script src="{{asset('assets/dist/js/adminlte.min.js')}}"></script>
<!-- AdminLTE for demo purposes -->
<script src="{{asset('assets/dist/js/demo.js')}}"></script>
<!-- page script -->
<script src="{{ asset('assets/layui/layui.js') }}"></script>

<script>


$(function(){

$.each($(".menu"),function(i){
               
     var _class = $(this).attr('class');   
     if(_class=="menu active"){
        $(this).parent().show()
     }              
});


})
  $(function () {


        $('.btn-submit').click(function(){
           
            var click_init = true;
            if ( $(this).data('check') ){
                window.location.href = $(this).data('url');
                return ;
                if ( window[$(this).data('check')] === false ){
                    return false;
                } 
            }
            if(!click_init){//防止多次提交数据
                return ;
            }
            click_init = false;
            var form     = $(this).closest('form');
            var url      = form.attr('action');
            var callback = window[ $(this).data('success') ] || null;
            var params   = form.serialize();
            post_send(url, params, callback);
            return false;
        });

        var post_send = function(url, params, callback){
            $.post(
                url,
                params,
                function(result){
                    if ( result.status ){
                        if ( callback ){
                            callback.call(null, result.data);
                        }else{
                            alert(result.msg);
                            window.location.href = result.data;
                        }
                    } else {
                        layer.alert(result.msg);
                    }
                },'json'
            );
        };

$(function(){

    $('body').on('click', '.ajax-get', function(){
        var _this    = $(this);
        var url      = _this.attr('href') || _this.data('url');
        var callback = _this.data('success');
        var text     = _this.data('confirm');

        if ( text && !confirm(text) ){
            return false;
        }

        $.get(url, {}, function(data){
            if ( data.status ){
                alert(data.msg);
                ajaxCallback[callback] && ajaxCallback[callback].call(_this, data.data);
            }else{
                alert(data.msg);
            }
        });
        return false;
    });

    var ajaxCallback = {
        reload: function(){
            window.location.reload();
        },
        removeTr: function(){
            $(this).closest('tr').remove();
        }
    }
});

});
</script>
     @section('script')
        <!-- load javascript here --> 
    @show

  </body>
</html>
